package com.example.swagger.controller;

import com.example.swagger.model.Test;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/testSwagger/")
@Api(value = "swagger测试API", tags = "swagger测试API类标识")
public class TestController {

    @RequestMapping(value = "swagger", method = RequestMethod.POST)
    @ApiOperation(value = "swagger测试方法")
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "name", value = "测试实体类参数-姓名", defaultValue = "测试", required = true),
//            @ApiImplicitParam(name = "sex", value = "测试实体类参数-性别", defaultValue = "男", required = true)
//    })
    public String list(@RequestBody Test test){
        return test.getName() + " test swagger";
    }

    @GetMapping("test")
    public String test() {
        return "hello";
    }
}
